package com.hui.mapper;

import com.hui.vo.RecodeVo;

import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Description
 * @date 2023/2/11 11:58
 */
public class RecodeVoMapper implements RowMapper<RecodeVo> {
    @Override
    public RecodeVo rowToEntity(ResultSet rs) {
        RecodeVo recodeVo = null;

        try {
            int id = rs.getInt("id");
            int productId = rs.getInt("productId");
            int mgrId = rs.getInt("mgr_id");
            int categoryId = rs.getInt("categoryId");
            int num = rs.getInt("num");
            Date createTime = rs.getDate("createtime");
            String loginName = rs.getString("login_name");
            String productName = rs.getString("productName");
            String categoryName = rs.getString("categoryName");
            String warehouseName = rs.getString("warehouseName");
            recodeVo = new RecodeVo(id, productId, mgrId, createTime, num, loginName, productName, categoryId, categoryName, warehouseName);

        } catch (SQLException e) {
            e.printStackTrace();
        }

        return recodeVo;
    }
}
